home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
sr
/
info.lha
/
info-sr.1992
/
000014_timbomb@cs.uq.oz.au _Thu Oct 8 14:43:46 1992.msg
< prev
next >
Wrap
Text File
|
1993-07-24
|
2KB
|
83 lines
Received: from uqcspe.cs.uq.oz.au ([130.102.192.8]) by optima.cs.arizona.edu (5.65c/15) via SMTP
id AA10159; Wed, 7 Oct 1992 21:43:14 MST
Received: from weevil.cs.uq.oz.au by uqcspe.cs.uq.oz.au
id <AA06080@uqcspe.cs.uq.oz.au>; Thu, 8 Oct 92 14:43:10 +1000
Message-Id: <9210080443.AA06080@uqcspe.cs.uq.oz.au>
To: info-sr@cs.arizona.edu
Subject: Possibly dumb crash question...
Date: Thu, 08 Oct 92 14:43:46 +1000
From: Tim Mansfield <timbomb@cs.uq.oz.au>
The SR that follows is two resources called eftpos2 and main.
Main is just there to call initiate() on eftpos2 to test the resource.
The problem is that the resource crashes with a Memory Fault at the last line
in bank() ("send pget(5)").
The code makes sense to me. Does anyone have any ideas why it should crash?
We're running SRv2.
tim
-------
resource eftpos2
op initiate()
optype get(i: int)
optype put(i: int; pget: cap get)
op pos(cput: cap put) returns q: cap get
op bank() returns p: cap put
body eftpos2()
proc initiate()
var pc: cap get
var bc: cap put
bc:= bank()
pc:= pos(bc)
end
proc bank() returns p
op bankput: put
var pget: cap get
p:= bankput
reply
in bankput(banktest, pget) ->
write("banktest", banktest)
ni
send pget(5) # memory fault here
end
proc pos(bankput) returns q
op posget: get
q:= posget
reply
send bankput(5, posget)
in posget(postest) ->
write("postest", postest)
ni
end
end eftpos2
resource main
import eftpos2
body main()
process maintest
var ec: cap eftpos2
var key: int
write("type a number to continue....")
read(key)
ec := create eftpos2()
ec.initiate()
end
end main